/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
'use strict';
import React, {
    Component,
} from 'react';

import {
    StyleSheet,
    Text,
    View,
    ScrollView,
    Image,
    TextInput,
    TouchableHighlight,
    ProgressBarAndroid,
    Alert,
    ToastAndroid,
    Dimensions
} from 'react-native';

import md5 from 'md5'
import StringEx from '../utils/stringex'
import CommonStyles from '../styles/common';
import {Actions} from 'react-native-router-flux'

var interval=null;
export default class LoginBindChoose extends Component {
    constructor(props) {
        super(props);
    }
    
    onPressToBind()
    {
        Actions.loginBindOpenid({catalog:this.props.catalog});
    }
    
    onPressReg()
    {
        Alert.alert('系统提示',this.props.catalog+'注册暂未实现！');
    }
    
    render() {
        return (
            <View style={[CommonStyles.container,CommonStyles.marginNavTop,CommonStyles.padding10]}>
                <Text style={CommonStyles.font20}>你好，{this.props.catalog}用户</Text>
                <Text style={[CommonStyles.font12,CommonStyles.marginTop10,{color:'#989898'}]}>如果已经注册过开源中国账户</Text>   
                <TouchableHighlight
                    style={[CommonStyles.button,{backgroundColor:'#5FC4D0'}]}
                    underlayColor='#87ceeb'
                    onPress={this.onPressToBind.bind(this)}>
                    <Text style={[CommonStyles.buttonText,CommonStyles.font16]}>绑定到已有帐号</Text>
                </TouchableHighlight>
                <Text style={[CommonStyles.font12,CommonStyles.marginTop10,{color:'#989898'}]}>如果还没有注册过开源中国账户</Text>   
                <TouchableHighlight
                    style={[CommonStyles.button,{backgroundColor:'#5FC4D0'}]}
                    underlayColor='#87ceeb'
                    onPress={this.onPressReg.bind(this)}>
                    <Text style={[CommonStyles.buttonText,CommonStyles.font16]}>立即开启开源之旅</Text>
                </TouchableHighlight>             
            </View>
        );
    }
}

const styles = StyleSheet.create({
    otherLoginView:{
        flex:1,
        marginTop:30
    },
    otherLoginText:{
        fontSize:16,
        marginBottom:10
    },
    QQLoginBg:{
        width:40,
        height:40,
        justifyContent:'center',
        alignItems:'center',
        backgroundColor:'#77C1FE',
        borderWidth: 0,
        borderRadius: 20,
    }
});
